<script lang="ts" setup>
import { bus } from "@/utils/mitt.js"
import { ref } from 'vue';
import { getCompanyIntroduce } from '@/api/set.js'
const title = ref()
const valueHtml = ref()
const visible = ref(false)
const open = () => {
    visible.value = true
}
bus.on("introduce", async (id: number) => {
    if (id == 1) {
        title.value = '公司介绍'
        valueHtml.value = await getCompanyIntroduce('公司介绍')

        // console.log(res);
    }
    if (id == 2) {
        title.value = '公司架构'
        valueHtml.value = await getCompanyIntroduce('公司架构')
    }
    if (id == 3) {
        title.value = '公司战略'
        valueHtml.value = await getCompanyIntroduce('公司战略')
    }
    if (id == 4) {
        title.value = '高层介绍'
        valueHtml.value = await getCompanyIntroduce('高层介绍')
    }
})
defineExpose({ open })
</script>

<template>
    <el-drawer v-model="visible" :title="title" :with-header="true">
        <span v-html="valueHtml" style="text-indent: 2em;  line-height: 1.5; text-indent: 2em;"></span>
    </el-drawer>
</template>

<style scoped lang="scss"></style>